package com.itany.corejava.code08_常用类.练习7;

/**
 * @author MissChen
 * @version 1.0
 * @date 2023 年11月17日 9:10
 */
public class Student implements ReturnString<Student>{
    private String name;
    private int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String returnString(Student student) {
        String username=student.getName();
        String[] arrs=username.split("");
        return String.join("-",arrs);//会自动将String类型的数组中的元素一个一个拆开用-连接

    }
}
